package com.example.educationblockchain.util;

import org.java_websocket.WebSocket;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@ConfigurationProperties(prefix = "block")
@Component
public class BlockCache {


	//当前节点的socket对象
	private List<WebSocket> socketsList = new CopyOnWriteArrayList<WebSocket>();

	private String password = "123456";
	

	//当前节点p2pserver端口号
	@Value("${block.p2pport}")
	private int p2pport;




	public List<WebSocket> getSocketsList() {
		return socketsList;
	}

	public void setSocketsList(List<WebSocket> socketsList) {
		this.socketsList = socketsList;
	}

	public String getPassword(){
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getP2pport() {
		return p2pport;
	}

	public void setP2pport(int p2pport) {
		this.p2pport = p2pport;
	}


}
